<?php
// no direct access
defined('_JEXEC') or die;
$baseurl = JURI::base();

if($headerText)
	echo $headerText;
?>
<script type="text/javascript" src="<?php echo $baseurl,'templates/',$app->getTemplate()?>/src/js/jquery.roundabout-shapes.min.js"></script>
<ul id="home-slideshow">
<?php
foreach($list as $item):
	$link = JRoute::_('index.php?option=com_banners&task=click&id='. $item->id);
	$imageurl = $item->params->get('imageurl');
	$width = $item->params->get('width');
	$height = $item->params->get('height');
	$alt = $item->params->get('alt');
	$alt = $alt ? : $item->name ;
	$alt = $alt ? : JText::_('MOD_BANNERS_BANNER') ;
	if($item->clickurl):
		$target = $params->get('target', 1);
?>
	<li>
		<div class="eachSlide clearfix">
			<img
					src="<?php echo $baseurl , $imageurl?>"
					alt="<?php echo $alt?>"
					<?php if (!empty($width)) echo 'width ="',$width,'"'?>
					<?php if (!empty($height)) echo 'height ="',$height,'"'?>
			/>
			<div class="slide-text">
				<div class="txt">
					<h1><?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8')?></h1>
					<p><?php echo $item->description?></p>
				</div>
				<a class="btnSlide-more"
				href="<?php echo $item->clickurl?>" <?php echo $target == 1 ? 'target="_blank"' : $target == 2 ? 'onclick="window.open(this.href, \'\', \'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=780,height=550\');return false"' : ''?>
				title="<?php echo htmlspecialchars($item->name, ENT_QUOTES, 'UTF-8')?>">Se mere her</a>
			</div>
		</div>
	</li>
<?php else://end clickurl?>
			<img
				src="<?php echo $baseurl , $imageurl?>"
				alt="<?php echo $alt?>"
				<?php if (!empty($width)) echo 'width ="',$width,'"'?>
				<?php if (!empty($height)) echo 'height ="',$height,'"'?>
			/>
<?php endif;
endforeach?>
</ul>
<?php if($footerText)
	echo $footerText;
?>
<script type="text/javascript">
$(window).load(function(){

	$("#home-slideshow").roundabout({
		tilt					: 0,
		minScale				: 0.4,
		minOpacity			  : 0.7,
		shape				   : 'lazySusan',
		autoplay				: true,
		duration				: 3500,
		autoplayDuration		: 6500,
		autoplayPauseOnHover	: true
	});

});
</script>